script.newObject("data", "PostData");
data.setContentType(data.Enum.CT_FormData);
data.appendFile("file", script.filepath(), "application/octet-stream");

script.newObject("request", "Request");
request.setUrl("http://www.filedropper.com/index.php?xml=true");

script.newObject("uploadreq", "WebRequest");
uploadreq.requestFinished.connect(uploadRequestFinished);
uploadreq.post(request, data);

function uploadRequestFinished() {
	request.setUrl(uploadreq.getContents());
	script.succeeded("Everything is ok: " + 
			"http://www.filedropper.com/" + request.urlGetParam("shorturl")
					);
	script.deleteObject("data");
	script.deleteObject("uploadreq");
	script.deleteObject("request");
}